﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GLYFrom
{
   public class DBHelper
    {
        static string con = "Data Source=.;Initial Catalog=XZXiangMu;Integrated Security=True";
        public static DataTable select(string sql)
        {
            SqlConnection conne = new SqlConnection(con);
            conne.Open();
            SqlDataAdapter comma = new SqlDataAdapter(sql, conne);
            DataTable table = new DataTable();
            comma.Fill(table);
            conne.Close();
            return table;
        }
        public static int ZSG(string sql)
        {
            SqlConnection conne = new SqlConnection(con);
            conne.Open();
            SqlCommand comma = new SqlCommand(sql, conne);
            int src = comma.ExecuteNonQuery();
            conne.Close();
            return src;
        }
    }
}
